load   c:\manoj\projects\substorm\SJGH;



H = SJGH(1:5:end);
fday = fday_sjg(1:5:end);
load c:\manoj\projects\ace\substorm;

Longitude = 284.45; 
lt_correction = Longitude / 15;

if lt_correction > 12,
    lt_correction =  lt_correction - 12;
else,
    lt_correction = -lt_correction;
end;

local_time_start = 9;
local_time_end = 16;

st = local_time_start + lt_correction;
en = local_time_end + lt_correction;


i_counter=0;
radius_epoch = 1/24;


for i = 1:length(fday_substorm),
        
    
           i_counter = i_counter+1;
           
           L = fday > fday_substorm(i) - radius_epoch & ...
               fday < fday_substorm(i) + radius_epoch;
           
           if sum(L) > floor(radius_epoch*2*(1440/5)),
               kkk = find(L ==1);
               L(kkk(1)) = 0;
           end;
           
           SEG(i_counter,:) = H(L);
           
           if (mod(i,1000) == 0)
        display(i);
            end;
            end;
            
            plot(nanmean(SEG));
           


